An improved spider optimization algorithm coordinated by pheromones

Swarm intelligence algorithm is an important evolutionary computation method that optimizes the objective function by imitating the behaviors of various organisms in nature. A two-stage swarm intelligence algorithm named spider pheromone coordination algorithm (SPC) is proposed in this paper. SPC tries to explore as many feasible solutions as possible on the cobweb at the positioning stage. It simulates the release and reception of different pheromones between spiders at the hunting stage, and then spiders move towards prey under the co-action of winds and pheromones. Different from the existing algorithms, SPC simulates the process that spiders accomplish intra-species communications through different pheromones and considers the impact on spider wind movement. A large number of typical benchmark functions are used in comparative numerical experiments to verify the performances of SPC. Experiments are made to compare SPC with a series of swarm intelligence algorithms, showing that SPC has higher convergence accuracy and stronger global searchability, effectively keeping the diversity of feasible solutions.


Biological fundamentals
Pheromones are chemicals that interact within a population of organisms and can carry specific information. They can affect the behaviors of animals and have both stimulating and inhibiting effects 27,28 . Some literature reported the presence of social pheromones in social groups to coordinate social life of groups 29,30 . Silk of spiders is not only the effective predation tool for spider groups but also a good carrier of pheromones. A large number of studies have confirmed that spiders can use pheromones remaining on silk of spiders or released into the air to carry out inter-specific communications to realize mutual cooperative behaviors. That is to say, silk of spiders can carry different pheromones and the proportion of pheromones on the cobweb in different periods is different 31 .
Pheromones can be divided into aggregation pheromones, alarm pheromones, trail pheromones and mark pheromones. Aggregation pheromones cause other individuals of the same species to move to the site of release source, thus forming an aggregation of population. Alarm pheromone has a positive feedback effect that can cause other people in the population to sound an alarm or flee. Moreover, the tracking pheromone has a negative feedback effect that can tell the traces of a person to other people in the same species and instruct other people in the population to transfer to the release source 28,[32][33][34] .
Spiders can use their silk to weave cobwebs. The silk of spiders and cobwebs are cornerstone of social activities of spiders 35 which can prevent excessive dispersion of spiders in the population and play an essential role in cooperation 36 . This shows the importance of cobwebs to social spiders, indicating that social spiders live on a cobweb most of their time. Spiders in SPC are supposed to be unable to leave the cobweb and can only move on it.
Based on biological facts, the heavier a spider is, the less the winds affect its movement. Conversely, the lighter a spider is, the more the winds affect its movement. Apparently, the number of prey caught by a spider is proportional to its own weight. Therefore, at the positioning stage of SPC, the effects of winds on movements of spiders are relatively large, and at the hunting stage of SPC, the effects of wind on movements of spiders will decrease. It should be noted that in SPC algorithm, the winds directly affect the movements of spiders rather than the spread of pheromones.

Spider pheromone coordination algorithm
SPC simulates the movements of social spiders which use pheromones for cooperative predation. In SPC, the optimization space of the optimization problem is abstracted into a multi-dimensional cobweb on which all social spiders live. Every location on the cobweb represents a feasible solution to the optimization problem. The locations on the cobweb form a corresponding one-to-one relationship with feasible solutions to the optimization problem. The optimal solution of this optimizing problem can be equivalently converted to finding an optimal location on the cobweb, the location of which depends on the size of prey that determines the objective function of the optimization problem. The value of objective function is the fitness value of spiders. Importantly, spiders may get out of the cobweb during random movements. However, spiders only can move freely on the web, because the locations outside cobweb represent unworkable solutions to the optimization problem. There are many methods to deal with boundary constraints in the previous literature, among which random method, absorption method and reflection method are the most widely used 37 . In this paper, stochastic method is used to deal with constraints.
Releasing and receiving pheromones are a form of communication within the population of spiders. When a spider begins to move, it receives pheromones distributed on the web, combining the winds, then it will choose which direction to move. When all spiders reach new locations, they start to release pheromones whose concentrations and types depend on the values of the objective function, that is, the fitness value of the spiders at these locations. Cobwebs are the transmission media of spiders' pheromones. The pheromones released by one spider will be received by all the other spiders in the population and affect movements of the rest of spiders. A global sharing information model is established by spiders sharing their own information indirectly through cobwebs and pheromones.
Scientific Reports | (2022) 12:5962 | https://doi.org/10.1038/s41598-022-09800-x www.nature.com/scientificreports/ After enough movements, the spiders will master the global information roughly, which can make a significant contribution to the subsequent optimization. SPC gives the cobweb a specific intelligence memory to record the outstanding solutions and the horrible solutions produced in every iteration at the first stage. After the positioning stage is completed, all the pheromones on the cobweb will be cleared entirely. In order to continuously guide the subsequent optimization process, the more representative extreme solutions will be selected from the solutions recorded on the cobweb, and the pheromones in their corresponding locations are updated to be marked pheromones or trail pheromones.
It should be noted that only mark pheromones and trail pheromones have persistent effects. In contrast, aggregation pheromones and alarm pheromones can only affect the movements of spiders in the next iteration. When the next iteration is completed, the original aggregation pheromones and alarm pheromones are cleared, spiders will release new aggregation pheromones and alarm pheromones.
Initializing population. The convergence speed of the SPC algorithm and the quality of the solutions are affected by the initialization of population. The initial population with good diversity is beneficial to improving the algorithm's optimization performance. In order to make the initial population have a certain degree of dispersion, the random method is used to initialize the population. This ensures the global search efficiency of the algorithm, the operability of the algorithm, and the diversity of individuals in the initial population.
The population size of spiders is invariable, which is denoted as N. The location of every spider in the Ddimensional space can be described as: x i = (x i1 , x i2 , . . . , x id , . . . , x iD ) , a feasible solution of optimization problem can be evaluated by the corresponding objective function f i that is the evaluation of the size of prey of the location. According to the value f i , the fitness value of location x i and spider i can be measured. By comparing the current location of each spider in initial population, the optimal location and the worst location in initial population were obtained, and the value of the objective function of the optimal location in the initial population was recorded as M.
Positioning stage. The hunting behaviors of social spiders can be described as the movements of spiders towards the locations of prey. Spiders receive and distinguish pheromones on the web to determine the potential directions of prey. The natural behaviors of spiders are used to optimize the solution space in SPC algorithm.
In the positioning stage, spiders only release aggregation pheromones and alarm pheromones. The cobweb records the locations of the terrible solution and the excellent solution produced by each iteration. While all spiders move to the new location, the pheromone is updated. The process in the positioning stage is shown in Fig. 1.
The locations of spiders are affected by the types and concentrations of pheromones released by other spiders. We take the value M of the optimal objective function in the initial population as the criterion. If the fitness value f j of spider j is better than M , Spider j releases aggregation pheromones that attract other spiders of the population to move closer to the location x j . The greater the absolute value of the difference between f j and M , the higher the concentration of aggregation pheromones released by spider j. On the contrary, if the fitness value f j of spider j is less than M , Spider j releases alarm pheromones, telling other spiders to move away from the location x j . The greater the absolute value of the difference between f j and M , the higher the concentration of the alarm pheromones released by spiderj. That is, the type of pheromones released by spider j is determined by the relationship between its corresponding fitness value f j and the size of M , and the concentration of pheromones released is proportional to the absolute value of the difference between f j and M.
The effect z ji of spider j on spider i can be quantitatively described by the following formula: x j and x i represent the locations of spider j and spider i respectively, f j is the fitness value of spider j. The movements of spider i are affected by all the pheromones on the web. Then, the effect Z i of other spiders in the population on the movements of spider i , which the following formula can quantitatively give: www.nature.com/scientificreports/ It should be noted that aggregation pheromones and alarm pheromones are highly volatile. In other words, the aggregation pheromones and alarm pheromones produced by every spider in every iteration only affect the movements of the spiders in the current iteration. They do not affect the movements of the spiders in the subsequent iteration. The aggregation pheromones and alarm pheromones indicated by formula 1 do not decay with distance or dissipate with time. Nevertheless, they will be updated at the end of each iteration.
Movements of spiders at positioning stage. The movements of spiders in nature are affected not only by the pheromones released by other spiders but also by the winds to a large extent. The speeds and directions of natural winds are difficult to be predicted. In order to facilitate operation, we set the wind as D-dimensional random vector wind , which can be perceived by all spiders, is updated at the beginning of every iteration. The wind is given by the following formula: ub is D-dimensional vectors, and it represents the upper bound of D-dimensional optimizing space, c w is a constant, random is a D-dimensional random vector in the range of 0 to 1. The effect W i of winds on spider i can be quantitatively described by the following formula: f i is the fitness value of the spider i , and M is the best fitness value of the initial population. c f is a constant. The moving step of a spider is described as r , it is a D-dimensional vector. It decreases with the increase of the number of iterations, which can be quantitatively described by the following formula: ub and lb are D-dimensional vectors, representing the boundary value of the cobweb in each dimension. ub represents the upper bound of D-dimensional optimizing space, and lb represents the lower bound of D-dimensional optimizing space. c r is a constant. t represents the number of iterations at the positioning stage. It p is the maximum number of iterations.
It should be noted that, in every iteration, the moving step r of the spiders in the population is the same. That is, spiders have the same ability to move. It also reflects the equality between spiders. The movements of spiders are realized by superposition of the current location vector and the moving vector, and are restricted by the moving step r. The moving vector depends on the winds and pheromones distributed on the web. Because spiders cannot fly, the locations of spiders do not change dramatically. That is, the starting location of every movement of the spider i is related to previous locations. The inertia weight c m1 is added, which determines the effect of the current locations of the spider on the movement of the spider. Thus it plays the role of balancing the global optimization and local optimization of the algorithm.
The location x i of spider i(i = 1, 2, . . . , N) is updated as follows: Z 0 i is the unit vector of Z i . c m1 is the inertial weight and we set it as a constant. After all spiders have moved to the new locations, they start releasing pheromones according to the value of the objective function of the new locations to update the pheromones on the web. The pheromones updated in the k th iteration could only affect the movements of spiders in the (k + 1) th iteration.
The more preys in this location are, the more concentration of aggregation pheromones released by spiders, and the spider will move towards the location in the next iteration. On the contrary, the fewer preys in this location are, the more concentration of alarm pheromones released by spiders, and the spider will move further away from the location in the next iteration. Cobwebs record the horrible solution and the outstanding solution generated by every iteration. In this way, the positive and negative feedback mechanism for realizing the interactions of spiders is established. The reasonable solutions play the role of positive feedback regulation, while the bad solutions play the role of negative feedback regulation.
If the spiders exceed the boundary of cobweb in random movements, the stochastic method is used to deal with the situation.

Selections of Cobweb.
In SPC, the cobweb is given a certain intelligent memory, and the cobweb records  Hunting stage. At the hunting stage of SPC, the trail pheromones at g s will guide the surrounding spiders towards g s . The mark pheromones at b s will guide the surrounding spiders to move away from b s ,where s = 1, 2, . . . , Y . Such a positive and negative feedback mechanism increases the possibility that the population of spiders will find better solutions.
At the hunting stage, there are three factors that affect the movements of spiders: one is the mark pheromones and trail pheromones stored on the web, the other is the aggregation pheromones and alarm pheromones produced by the population of spiders, and the third is the winds.

Guidance of Cobweb.
In order to measure the effectiveness of the 2Y extreme solutions on movements of spiders at the hunting stage, it is necessary to determine the influence space of mark pheromones and trail pheromones. We define a D-dimensional vector R , when spider i is in the D-dimensional solution space with R radius centered on an extreme solution, which means that the extreme solution will regulate and guide the movement of spider i .If spider i is not in this D-dimensional solution space, this extreme solution does not regulate and guide the movement of spider i. If spider i enters the D-dimensional solution space where the central location is trail pheromones, it will move towards the center. On the contrary, if spider i enters the D-dimensional solution space where the central location is marked pheromones, it will move away from the center.
These two types of extreme solutions guide the movements of spiders so as not to waste known information resources. Moreover, spiders affected by two kinds of pheromones can catch prey more accurately and exploit the solution space better than spiders affected by only one kind of pheromones. Although the amount of information is multiplied, the base is small, only 2Y. So the spiders can still react quickly without affecting the overall speed of iteration. The process in the hunting stage is shown in Fig. 2.
The radius R is expressed by the following formula: The formula for quantifying the effect Wg s i of the extremely good solution g s on spider i is as follows: The formula for quantifying the total effect Wg i of extremely good solutions on spider i is as follows: Accordingly, the formula for quantifying the effect Wb s i of the extremely bad solution b s on spider i is as follows: The formula for quantifying the total effect Wb i of extremely bad solutions on spider i is as follows: The formula to quantify the effect W i of all extreme solutions on spiders i is as follows: After the positioning stage of SPC was completed, the weight of spiders in the population increased. Considering that the weight of spiders is an important resistant factor of winds, the effect of winds on movements of spiders should be adjusted. That is to say, at the positioning stage of the algorithm, the winds have a significant effect on the movements of spiders, while at the hunting stage of the algorithm, the effect of winds on spiders should be reduced to some extent. By changing the moving formula, the effect of winds can be reduced appropriately. The moving step r of the spiders at the hunting stage of SPC is expressed by the following formula: h is the number of iterations at the hunting stage, ub and lb are D-dimensional vectors, representing the boundary value of the cobweb in every dimension. ub represents the upper bound of D-dimensional optimizing space, and lb represents the lower bound of D-dimensional optimizing space. The moving formula of spider i at the hunting stage of SPC is as follows: Z i can be obtained from formula 2, wind can be obtained from formula 3, W i can be obtained from formula 4, r can be obtained from formula 3. c m2 is the inertial weight of the hunting stage, it is set to a constant. If the spider i goes beyond the boundary of the cobweb in the process of random walk, the random method is used to deal with the constraint 32 .

Implement of SPC.
By simulating the collaborative hunting process of spiders, the optimizing model of SPC is acquired. SPC has two stages: the interactions of spiders using pheromones and the cobweb's guidance to spiders' movements. At the positioning stage, every spider adjusts its location according to the distribution of pheromones on the web. The more the preys at the location are, the more concentration of aggregation pheromones released by the spiders at the location. And the other spiders tend to move to that location in the next movement. On the contrary, the smaller the prey at the location are, the higher the concentration of alarm pheromones released by the spiders are, and the other spiders move away from that location in the next movement. In this way, more feasible solutions can be found to a greater extent, which is helpful to record the extreme solutions for cobweb that can better reflect the global information and make the cobweb guide the movements of the spiders at the hunting stage from the global perspective. At the hunting stage of SPC, spiders communicate with other spiders to produce better solutions by using the mark pheromones and trail pheromones on the web, and the aggregation pheromones and alarm pheromones produced by themselves.
All spiders are equally based on shared information. There is no leader, so there is no case where the individual dominates the movements of the group, but the interactions between spiders guide the movements of the spiders. In this way, it avoids falling into individualism, which results in premature accumulation of the whole www.nature.com/scientificreports/ population stagnation of evolution. Moreover, the diversity of the population can not be effectively maintained, which is easy to fall into local optimization. SPC algorithm can jump out of local optimization to realize global optimization because of randomness. Under the adjustment of positive and negative feedback of pheromones, it can not only receive the effect of outstanding solutions but also suppress the interference of horrible solutions. SPC makes full use of the adequate existing information on the cobweb. It does not waste information resources or generate information redundancy.
The new locations of all spiders are constructed by the current locations and historical locations of other spiders in the population. It can retain the past information, prevent the algorithm from jumping too fast, and make the algorithm evolve smoothly. With the increase of the number of iterations, the dynamic moving step r decreases nonlinear, which plays a great role in the convergence of SPC. It makes SPC have strong global optimization ability in the positioning stage, at the hunting stage, it gradually converges to a better area. Therefore, it balances the ability of global optimization and local optimization more effectively. In addition, the random vector wind can ensure the diversity of the population of spiders and the randomness of SPC algorithm.
SPC assumes that overall optimization space is a cobweb, and spiders can interact indirectly through pheromones. Every solution in the optimization space is represented by a location on the web. The process of SPC algorithm can be described by algorithm 1.
Step 1 Set the size of population to N and the dimension of optimization space D , randomly initialize the locations of the population of spiders.
Step 2 Sort and compare the fitness values of spiders in the initial population, select the spider with the best fitness value, and record its fitness value as M .
Step 3 Spiders interact through pheromones according to formula 1.
Step 4 The locations and pheromones of spiders were updated respectively according to formula 6.
Step 5 If the new locations of the spiders exceeds the boundary of the cobweb, the random method is used to constrain the spiders.
Step 6 If the maximum number of iterations in the positioning phase is not reached, go to step 3.
Step 7 Select the extreme solutions and record their information.
Step 8 The cobweb guides the movements of spiders according to formula 8 and formula 10.
Step 9 Update the locations of the spiders according to formula 14.
Step 10 If the new locations of the spiders exceeds the boundary of the cobweb, the random method is used to constrain the spiders.
Step 11 If the maximum number of iterations in the hunting phase is not reached, go to step 8. In SSA, when a spider finds its prey, it creates a strong vibration that attracts the rest of the spiders to move towards it. Eventually, most of the spiders in the group will gather around the prey.
For SSO and SSA, pheromones were not used, and the effect of winds on movements of spiders was not considered.
SPC considers that pheromones of spiders are the communicating medium between organisms. It divides the whole optimization process into two stages. At the positioning stage, the releasing and receiving process of aggregation pheromones and alarm pheromones are abstracted into the process of interactions of spiders. Communications of pheromones complete the update of spiders' locations. The new locations of spiders are constructed by their historical locations together with the distribution of other spiders and the winds at that time. The primary task of the positioning stage is to explore the solution space as much as possible. SPC gives the cobweb a certain intelligence -the memory so that the cobweb can record the extreme solutions that reflect the global information. At the hunting stage, the movements of spiders are guided by the distribution of the extreme solutions recorded by the cobweb so that the spiders can converge to the good solutions as much as possible. While many intelligent algorithms try to avoid extreme individuals from affecting the optimization process, SPC skillfully uses extreme solutions to guide the movements of the spiders.

Experiment and result
In this section, the SPC method is evaluated from several aspects. The parameter of SPC would be discussed, and the comparison between SPC and some existing algorithms would be made using a series of benchmarks. The experiments are performed using Matlab R2018a on a Windows laptop with an Intel Core i5 processor and 24 GB of RAM.
Parameter selection. Choosing appropriate parameters of SPC for numerical and real-world optimization problems can be time-consuming. In this paper, single-factor sensitivity analysis is used to select appropriate parameters. The five parameters in the equations of SPC are further discussed.
c w ,c f : These two parameters jointly determine the effect of wind on the spiders' movements.  Fig. 3 with dots, and the second-order polynomial regression curve for each function is also plotted for demonstration. Some interesting observations can be obtained from the mean results and the regression curve. From Fig. 3, it can be observed that the experimental results have differences when the four parameters of c r , c f , c w and c m1 change in the five functions. Therefore, the values of these parameters depend largely on the nature of the optimization problem to be solved. For the parameter c m2 , the experimental results are robust.
So the parameters are set as c r = 2,c f = 5,c w = 5,c m1 = 2 and c m2 = 2.5 in the next simulation experiment. Please note that this parameter combination can not guarantee the optimal solution for solving all optimization problems . And parameter tuning is essential to address unfamiliar problems.The parameter sensitivity analysis in this paper is preliminary, that is, only one parameter is tested while the remaining four are unchanged. For HHO, the number of harris hawks is set to 30. For MBO, the population size is set to 50. For PSO, the learning factors c 1 and c 2 are equally set to 3, the inertia weight ω is set to 0.5, and particle amount is set to 30. For SSO, the number of spiders is set to 30. For SSA, the number of spiders is set to 25. Other parameters involved in the comparison algorithms are given by their original literature.

Statistical and convergence comparison on 35 benchmarks. Thirty
In these experiments, the number of iterations is set to 1000. The dimension D is unified to 30. The scope of the optimization space is given by the scope of the benchmark functions. Considering the randomness of the parameters in the swarm intelligence algorithm, the experiment of every benchmark function runs 100 times independently. The average values of the convergence results of 100 runs are calculated as the final results. Table 1 lists the statistical results of the algorithms running 100 times independently for 35 benchmark functions. AVG stands for average values, and STD stands for the standard deviation of values. The best results are shown in bold.
Here are some zeros in Table 1. This is because the values are very close to zero and are smaller than the minimum value that Matlab could discriminate.  Table 1, the following information could be attained. SPC has the best results on 21 out of 35 benchmark functions, which hold first place on the number of best results. The second most at the number of best results is HHO, which has 16 out of 35 benchmark functions. On some benchmark functions, both SPC and HHO get the best results. SSO has one best results on the experiments. The rest of the algorithms do not take any place in experiments. The results of experiments show the effectiveness and good ability of SPC. The average and standard deviation values from SPC on most of the benchmark functions indicate the accuracy and stability of SPC.
Because unimodal functions have only one global optimal value, they can be used to evaluate the function's exploitation capability. According to Table 1, SPC has excellent exploitation capability. This can be seen from the optimization results of the SPC for the single peak function. For example, for the unimodal functions fun1 and fun11, the results of SPC are superior to other algorithms, indicating that the SPC has strong competitiveness.  www.nature.com/scientificreports/ Unlike one-dimensional functions, multimodal functions have many locally optimal solutions, the number of which grows exponentially with the dimension of the problem. Therefore, multimodal functions are very effective for evaluating the exploration capability of the algorithm. Particularly, fun29 is the Schaffer function, which is a two-dimensional complex function with an infinite number of minima. It gets the global minimum of 0 at (0,0). Because the function has strong oscillatory behavior, it is difficult to find the optimal global value in the traditional optimization algorithm. Since SPC explored a wide range of globally feasible solutions during www.nature.com/scientificreports/ the positioning stage, its results almost approach to 0 completely. In addition, fun13 is the Griewank function, which is a typical nonlinear multimodal function with a broad search space and is generally considered as a complex multimodal problem that is difficult to deal with for optimization algorithms. Its global minimum is obtained at zero, which is 0. SPC also performs very well in the optimization results of this function. Its results are also nearly close to 0, which is obviously better than other algorithms, indicating that its global search ability is better than other algorithms. The stability of algorithms greatly influences not only the standard deviation but also the average. The reason is that the average value of many executions instead of the medium value that is used as the final result in most cases. For example, assuming the solution of a problem is 0, the final result is the average of the results of 100 executions. The final result would be enormous if the algorithm got zero by 99 out of 100 executions, and only one execution got an enormous value. From Table 1, the results show that SPC is the most stable algorithm and MBO is the most unstable algorithm.
It should be noticed that the number of spiders in SPC is only 4, or that is to say, the search agent of SPC is 4. Compared with the number of search agents, which is 10, 30, or more, SPC uses fewer agents to get better performance, which further demonstrates the superiority of design and construction in SPC.
Make a further investigation on the results obtained by SPC and HHO, and it can be found that SPC can get more precise results than HHO when SPC has a good result on the function, while HHO may have good results on more functions than SPC. In other words, SPC can reach better precision while it may not be effective for that many cases, and HHO could be used in more cases, but results are not that precise. The universality of SPC may be a disadvantage of SPC and should be improved in future work. Figure 4 shows the convergence curves of 9 algorithms on 35 benchmark functions. The blue lines stand for the curves of SPC. The convergence curves of SPC obviously reflect the two stages of SPC. During the positioning stage of SPC, it continuously explores feasible solutions in a global scope. SPC will not converge at this stage, so its convergence curve is constantly oscillating at this stage. At the hunting stage, it can quickly converge to the optimal solution of the whole scope, which shows that SPC can escape from the optimal local solution. Some solutions at the global scope may have extreme values, which cause the pulse on convergence curves, like fun2, fun6, fun11, and fun19. While the function is sensitive to the change of solution, the curves of fitness values will move wildly, like fun6 and fun22. SPC is not the most quickly converged algorithm due to the theory of SPC, and through the curve, HHO is the quickest converged algorithm among the algorithms involved.
Box plot can reflect the spread of data. Figure 5 is the box plot of fitness values during coverage progress for each algorithm on benchmark functions. In Fig. 5, the box of SPC is wide, and the absolute value of the maximum and minimum values of SPC is quite different from other algorithms. Only a few data are close to the optimal global solution, which reflects the structure of the algorithm. The SPC algorithm mainly does not retain the optimal solution during the positioning phase, and it keeps exploring other feasible solutions. That is, the first stage task of SPC is to explore the search space as much as possible so that it will fluctuate in the region of the optimal local solution. At the hunting stage, based on the information obtained in the positioning stage, it can quickly converge to the complete optimal solution, indicating that the improved algorithm has the ability to escape from the optimal local solution.
Statistical comparison on higher dimensions. From the previous experiments, SPC performs well when the dimension of the problem is 30. To further investigate the performance of SPC, the experiments should be done with problems having higher dimensions. In this case, the dimension of benchmark functions increased to 100, and 6 algorithms are involved in the experiments, including SPC, SSA, SSO, GWO, HHO, and PSO. The results are shown in Table 2.
From Table 2, the results of SPC are close to previous experiments. It can be concluded that the increase of dimensions has nearly no effect on the performance of SPC, both on precision and stability. SPC also performs well on high-dimensional problems. The increase of dimensions negatively affects the other algorithms at different levels. For SSA, the results of some functions get greatly worse, like fun2 from 1.325e+45 for 30 dimensions to 4.511e+170 for 100dimensions, fun11 from 5.578e−01 for 30 dimensions to 1.406e+42 for 100 dimensions and so on. Most of the rest get slightly worse. The situation of SSO is similar to SSA. For GWO and HHO, the influence of the increase of dimension is mainly on the precision of results. Most of the results do not change a lot but are less accurate than that of 30 dimensions. For PSO, most of the results are slightly worse than that of 30 dimensions. It can be said that SPC has excellent performance when the dimensions increase compared to the other algorithms involved in the experiments.
Comparison on engineer problems. In this part, SPC is applied to two engineering problems: three-bar truss design problem and tension-compression spring design problem. The results of SPC are compared to several algorithms, including GWO, HHO, SSA, SSO, PSO.
The three-bar truss design problem is a well-known structural design problem in practical engineering applications. A graphical illustration of some components of the design problem is shown in Fig. 6. The problem aims to obtain the minimum weight, but it also needs to be subject to several constraints , such as stress, deflection, and buckling constraints. The problem is formulated as follows. The tension-compression spring design problem is another design problem in practical engineering applications. It aims to optimize the weight of the spring. And during the optimization, shear stress, surge frequency, and minimum deflection should be satisfied during the weight optimization. The problem is formulated as follows.  Table 3. In Table 3, three-bar truss design problem is referred to as EF1, and tension-compression spring design problem is referred to as EF2.
The results show that all the involved problems have similar performance on the two engineering problems except PSO on EF2. The reason why they have similar results may be the low dimension and complexity of the   Discussion on results. The parameters of SPC are carefully selected. The performance of the method proposed in this paper, SPC, is tested from three aspects. The results of SPC on most of the 35 benchmark functions show the precision and stability of SPC. And the experiments with higher dimensions indicate that SPC is quite suitable for high dimension problems, the increase of dimension does not negatively affect the performance of SPC. The experiments of typical engineering problems validate its performance on application. With the advantages mentioned, SPC also has problems to be improved. For example, its universality is ferior to some existing algorithms.

Conclusion
In this work, a novel spider algorithm based on pheromones and cobwebs called SPC is proposed. A positive and negative feedback mechanism in the population of spiders is established by accurately using the effects of different pheromones on spiders. Furthermore, it performs an important role in the progress of SPC. The memory of the cobweb is proposed to be used in the algorithm to realize the communication of pheromones across time. The performance of SPC was investigated. The experiment results show that SPC had excellent performances compared with other algorithms.
In future work, SPC should be further adjusted to obtain better performance, and the weak points of SPC should be strengthened. Besides that, a complete parameter sensitivity analysis is one of the future research topics of SPC. After that, applying this algorithm to practical problems and verifying the performance of the algorithm by extending this algorithm to multi-objective scenarios are the important directions.